<template>
    <div class="detail-table">
        <div class="detail-table">
            <i class="el-icon-s-grid">
                <span>装配工单—产品明细</span>
            </i>
        </div>
        <mes-table style="padding: 0px 10px 10px;" ref="editTablel" :columns="columns" :max-height="270" :index="true"
            :tableData="rows" :pagination-hide="true">
        </mes-table>
    </div>
</template>

<script>
import MesTable from "@/components/basic/VolTable";
import { ref,reactive } from "vue";
export default {
  components: { MesTable },
  data() {
    return {
        columns: reactive( [{field:'AssembleWorkOrderList_Id',title:'装配工单明细表主键ID',type:'int',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'AssembleWorkOrder_Id',title:'装配工单Id',type:'int',width:110,hidden:true,require:true,align:'left'},
                       {field:'LevelPath',title:'层级编号',type:'string',width:220,align:'left',sort:true},
                       {field:'ProductCode',title:'产品编号',type:'string',sort:true,width:220,readonly:true,require:true,align:'left'},
                       {field:'ProductName',title:'产品名称',type:'string',sort:true,width:220,readonly:true,require:true,align:'left'},
                       {field:'ProductionSchedule',title:'生产进度',type:'string',width:220,readonly:true,align:'left'},
                       {field:'ProductStandard',title:'产品规格',type:'string',width:220,readonly:true,align:'left'},
                       {field:'ProductAttribute',title:'产品属性',type:'string',bind:{ key:'productAttr',data:[]},width:220,readonly:true,require:true,align:'left'},
                       {field:'Unit_Id',title:'单位',type:'int',bind:{ key:'unitlist',data:[]},width:110,readonly:true,require:true,align:'left'},
                       {field:'UnitNumber',title:'单位数量',type:'int',width:110,require:true,align:'left'},
                       {field:'Number',title:'数量',type:'int',sort:true,width:110,require:true,align:'left'},
                       {field:'WorkOrderCode',title:'工单编号',type:'string',width:220,readonly:true,align:'left'},
                       {field:'Status',title:'状态',type:'string',bind:{ key:'workOrderStatus',data:[]},width:220,readonly:true,align:'left'},
                       {field:'FinishNumber',title:'完成数',type:'int',width:110,readonly:true,align:'left'},
                       {field:'BadNumber',title:'不良品数',type:'int',width:110,readonly:true,align:'left'},
                       {field:'ProcessLine_Id',title:'工艺路线',type:'int',width:110,hidden:true,readonly:true,align:'left'},
                       {field:'Product_Id',title:'产品ID',type:'int',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'CreateDate',title:'创建时间',type:'datetime',sort:true,width:150,align:'left',sort:true},
                       {field:'Creator',title:'创建人',type:'string',width:100,align:'left'},
                       {field:'Updator',title:'修改人',type:'string',width:220,align:'left'},
                       {field:'UpdateDate',title:'修改时间',type:'datetime',width:150,align:'left',sort:true}]),
      rows: []
    };
  },
  methods: {
    rowClick(row) {
    let url = "/api/AssembleWorkOrder/getDetailRows?AssembleWorkOrder_Id=" + row.AssembleWorkOrder_Id
    this.http.get(url, {}, true).then(rows => {
    this.rows = rows;
    })
  }
    }
};
</script>
<style lang="less" scoped>
.detail-table {
    padding: 0px 4px;
    border-top: 10px solid rgb(238, 238, 238);

    h3 {
        font-weight: 500;
        padding-left: 10px;
        background: #fff;
        margin-top: 8px;
        padding-bottom: 5px;
    }
}

.detail-title {
    padding: 10px;
    font-size: 15px;
    color: '#313131';
    font-weight: bold;

}
</style>